import utils

config = utils.get_config();
dictMap = {};
d = open(config.get('rmls', 'dictionary'), 'r');
index = 0;
for line in d:
    dictMap[index] = line.strip('\n').split('\t')[0].decode('utf-8');
    index += 1;
d.close();
MAX = len(dictMap);
print MAX;


f = open('plot_D_S', 'w');
p = open('d_I', 'r');
for line in p:
	li = line.strip().split('\t');
	s = float(li[2])
	i = int(li[0]);
	j = int(li[1]);
	f.write('%f,%d,%d,%s,%s\n' % (s, i, j, dictMap[i].encode('utf-8'), dictMap[j].encode('utf-8')));

f.close();
p.close();

